<%--
  Created by IntelliJ IDEA.
  User: 说好的幸福呢
  Date: 2021/5/19
  Time: 14:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<script type="text/javascript" src="js/jquery.js"></script>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="updateStu.do" method="post" enctype="multipart/form-data">
    <input type="hidden" name="id" value="${requestScope.stu.id}"/>
    姓名:<input type="text" name="name" value="${requestScope.stu.name}"/><br/><br/>
    性别:男<input type="radio"
               <c:if test="${requestScope.stu.gender==\"男\"}">checked</c:if> value="男" name="gender"/>
    女<input type="radio"
            <c:if test="${requestScope.stu.gender==\"女\"}">checked</c:if> value="女" name="gender"/><br/><br/>
    生日:<input class="Wdate" value="${requestScope.stu.bir}" name="bir" type="text" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'})"><br/><br/>
    爱好:
    抽烟<input type="checkbox"
             <c:if test="${fn:contains(requestScope.stu.hobby,\"抽烟\")}">checked</c:if> value="抽烟" name="hobby"/>
    喝酒<input type="checkbox"
             <c:if test="${fn:contains(requestScope.stu.hobby,\"喝酒\")}">checked</c:if> value="喝酒" name="hobby"/>
    rap<input type="checkbox"
              <c:if test="${fn:contains(requestScope.stu.hobby,\"rap\")}">checked</c:if> value="rap" name="hobby"/>
    烫头<input type="checkbox"
             <c:if test="${fn:contains(requestScope.stu.hobby,\"烫头\")}">checked</c:if> value="烫头" name="hobby"/><br/><br/>
    头像:<input type="hidden" name="oldPhoto" value="${requestScope.stu.photo}">
    <input type="file" name="file" onchange="hideImg()">
    <img id="show" src="/upload/${requestScope.stu.photo}" height="100px"/><br/><br/>
    <input type="submit" value="修改学生">
</form>
</body>
<script type="text/javascript">
    function hideImg(){
        $("#show").hide();
    }
</script>
</html>
